/* eslint-disable react-hooks/rules-of-hooks */
/*
 * @Author: mylesshie@gmail.com
 * @Date: 2020-07-14 15:19:14
 * @LastEditors: mylesshie@gmail.com
 * @LastEditTime: 2020-08-15 21:54:11
 * @description:
 */

import React, { useCallback, useEffect, useState } from 'react'
import { useDispatch } from 'react-redux'
import { Text, SafeAreaView, TouchableOpacity, TouchableWithoutFeedback, ImageBackground, Image, Linking } from 'react-native'
import { Platform, CameraRoll } from 'react-native';
import MessageItem from '@/components/MessageItem'
import styles from './styles'
import * as userActions from '@/actions/user'


const image = require('../../assets/images/contact_back.png')
const img_contacter = require('../../assets/images/contacter.png')
const img_qrcode = require('../../assets/images/qrcode.png')
const img_phoneNumber = require('../../assets/images/phoneNumber.png')
// const logo = {require('@/')}
const ConnectService = props => {
  const dispatch = useDispatch()
  const [commentList, setCommentList] = useState([])
  const [pageNum, setPageNum] = useState(1)
  const [isRefreshing, setIsRefreshing] = useState(false)
  const [pageEnd, setPageEnd] = useState(false)
  const pageSize = 20


  // const getList = useCallback(() => {
  //   dispatch(userActions.getMessages(pageNum, pageSize)).then(res => {
  //     setIsRefreshing(false)
  //     if (pageNum === 1) {
  //       setCommentList(res.list)
  //     } else {
  //       setCommentList(commentList.concat(res.list))
  //     }
  //     setPageEnd(res.total <= res.pageNum * res.pageSize)
  //   })
  // }, [dispatch])

  // useEffect(() => {
  //   getList()
  // }, [pageNum, pageSize])




  return (
    <>
      <SafeAreaView style={styles.wrap}>
        <ImageBackground source={image} style={styles.container} >
          <TouchableOpacity onPress={() => {
            return Linking.openURL('tel:19182290556');
          }}>
            <Image source={img_phoneNumber} style={styles.phone} />

          </TouchableOpacity >
          <Image source={img_contacter} style={styles.connecter} />
          <TouchableWithoutFeedback onPress={() => {
            // console.log("dasdasda")

          }}>
            <Image source={img_qrcode} style={styles.qrcode} />

          </TouchableWithoutFeedback >
          <Text style={styles.pageEndText}>
            如有问题请拨打上方电话

          </Text>
          <Text style={styles.pagestartText}>
            或添加微信直接联系到客服
          </Text>





        </ImageBackground>
      </SafeAreaView>
    </>
  )
}

export default ConnectService
